#ifndef MYSERIAL_H
#define MYSERIAL_H

#include <QWidget>
#include "QSerialPort"     //串口访问
#include "QSerialPortInfo" //串口端口信息访问
#include <QList>

class MySerial:public QObject
{
    Q_OBJECT
public:
    explicit MySerial(QObject *parent = nullptr);
    virtual ~MySerial();


    bool  Serial_Open(QMap<QString, QString> map); //打开串口
    void  Serial_Close();                          //关闭串口
    QList<QString> get_SystemPort();               //搜索串口

    void  RevData();
    void Test();
public slots:
     void  SendData(QString Str);
signals:
    void getRev(QString Str);
private:
    QSerialPort SerialPort;   //串口句柄
    qint8 ID;                 //串口ID


};

#endif // MYSERIAL_H
